﻿using UnityEngine;
using System.Collections;

public class GoalArea : MonoBehaviour {

	public ParticleSystem psStar;


	public int score {get;  set;}


	// Use this for initialization
	void Start () {
		score = 0;
	}



	void OnTriggerEnter (Collider other) {
		ShotBall sb = other.GetComponent<ShotBall>();
		if (sb != null) {
			// Goal!!
			score++;
			int oldItemCount = PlayerPrefs.GetInt("multipule_item_count", 0);
			if(oldItemCount > 0)
			{ 
				PlayerPrefs.SetInt("multipule_item_count", oldItemCount - 1);
				score += 2;
			}
			psStar.Play();
		}
	}

}
